package android.microblog.Views;

import android.content.Context;
import android.microblog.Data.UserInfo;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class UserSpinnerAdapterView extends LinearLayout {
	public static final String LOG_TAG = "UserSpinnerAdapterView";

	public UserSpinnerAdapterView(Context context, UserInfo user) {
		super(context);
		this.setOrientation(HORIZONTAL);
		LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(
				LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		iconParams.setMargins(1, 1, 1, 1);

		ImageView userIcon = new ImageView(context);
		userIcon.setBackgroundDrawable(user.getUserIcon());
		addView(userIcon, iconParams);
		LinearLayout.LayoutParams infoParams = new LinearLayout.LayoutParams(
				LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
		infoParams.setMargins(1, 1, 1, 1);
		TextView userInfo = new TextView(context);
		userInfo.setText(user.getUserName());
		addView(userInfo, infoParams);

	}

}
